<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>账号注册-家会网</title>
        <link href="__PUBLIC__/Css/login.css" rel="stylesheet" type="text/css">
            <script type="text/javascript" src="__PUBLIC__/Js/jquery-1.8.3.min.js"></script>
            <script type="text/javascript" src="__PUBLIC__/Js/common.js"></script>
    </head>
    <body>
        <div class="mininav">
            <div class="mininavInner w990">
                <div class="mininavLeft fleft"> 
                    <img src="__PUBLIC__/Images/logo.jpg" align="absbottom" class="fleft" />
                    <h2>账号注册</h2>
                    <div class="clean"></div>
                </div>
                <div class="mininavRight fright"><a href="login.html">登录</a>  |  卖场爆破  |  E网打尽  |  电子杂志  | 分销商</div>
                <div class="clean"></div>
            </div>
        </div>
        <div class="container w990">
            <div class="zhuce">
                <div style="width:680px; height:500px;float:left;margin:0 0 0 50px">
                    <form action="__APP__/Member/register" method="post" id="form1">
                        <table width="680" height="500" border="0" align="center" cellpadding="0" cellspacing="0">
                            <tr> </tr>
                            <tr>
                                <td width="15%" height="35" class="zhuce_td" style="font-size:14px;"><span class="fred">*</span>您的用户名：</td>
                                <td width="85%"><label>
                                        <input name="username" type="text" class="login_right_b" id="username" 
                                               onfocus="setUsernameInfo()" onblur="checkUsername(this.value)" />
                                    </label></td>
                            </tr>
                            <tr>
                                <td height="35">&nbsp;</td>
                                <td id="usernameInfo"></td>
                            </tr>
                            <tr>
                                <td width="16%" height="35" class="zhuce_td" style="font-size:14px;"><span class="fred">*</span>您的邮箱地址：</td>
                                <td width="85%"><label>
                                        <input name="email" type="text" class="login_right_b" id="email" onfocus="setEmailInfo()" onblur="checkEmail(this.value)" />
                                    </label></td>
                            </tr>
                            <tr>
                                <td height="35">&nbsp;</td>
                                <td id="emailInfo">请输入您的常用邮箱地址</td>
                            </tr>
                            <tr>
                                <td height="32" class="zhuce_td"  style="font-size:14px;"><span class="fred">*</span>注册类型：</td>
                                <td>
                                    <select id="member_type" name="member_type" style="width:124px">
                                        <option>请选择</option>
                                        <volist name="typeData" id="list">
                                            <option value="{$list.id}">{$list.type_name}</option>
                                        </volist>
                                    </select>
                                </td>
                            </tr>
                            <tr>
                                <td height="35">&nbsp;</td>
                                <td>请选择你注册的会员类型</td>
                            </tr>
                            <tr>
                                <td height="32" class="zhuce_td"  style="font-size:14px;"><span class="fred">*</span>请输入密码：</td>
                                <td><input name="pwd" type="password" class="login_right_b" id="pwd" onfocus="setPasswordInfo()" 
                                           onblur="checkPassword(this.value)"/></td>
                            </tr>
                            <tr>
                                <td height="35">&nbsp;</td>
                                <td id="passwordInfo">6-16位字符（字母、数字、符号），区分大小写</td>
                            </tr>
                            <tr>
                                <td height="56" class="zhuce_td"  style="font-size:14px;"><span class="fred">*</span>再次输入密码：</td>
                                <td><input name="cofpwd" type="password" class="login_right_b" id="cofpwd" onblur="confPassword(this.value)"/></td>
                            </tr>
                            <tr>
                                <td height="47" class="zhuce_td"  style="font-size:14px;"><span class="fred">*</span>输入验证码：</td>
                                <td>
                                    <input style="width:80px;" name="verifycode" type="text" class="login_right_b" id="verifycode" />
                                    <img id="verifyImg" src='__APP__/Public/verify/' /><a href="javascript:void(0)" onclick="fleshVerify()">换一张</a>
                                </td>
                            </tr>
                            <tr>
                                <td height="54" rowspan="2">&nbsp;</td>
                                <td><label>
                                        <input type="checkbox" name="clause" id="clause" value="1" />
                                        我已经看过并同意<a href="fuwuxieyi.html" target="_blank" class="blue">服务协议</a></label></td>
                            </tr>
                            <tr>
                                <td>
                                    <a href="javascript:void(0)" onclick="return submitForm('form1')">
                                        <img src="__PUBLIC__/Images/zhuce.jpg" width="200" height="30" /></a>
                                </td>
                            </tr>
                        </table>
                        <b style="color:#ff0000" id="errorInfo"></b>
                    </form>
                </div>
                <div class="zhuc_re" style="float:left">
                    <h3><strong>家会网会员享四大特权</strong></h3>
                    <p>1.免费发布供求信息</p>
                    <p>2.免费拥有一个企业商城</p>
                    <p>3.免费发布企业商品</p>
                    <p>4.即时获家居行业最新市场动态</p>
                </div>
                <div style="clear:both"></div>
            </div>

        </div>   
        <div class="login_bottom">
            <p>家会网 版权所有</p>
            <p> 如需帮助，请拨打 400-500-6789 Copyright&copy;2013 Jiahuiwang Corporation, All Rights Reserved </p>
        </div>
    </body>
</html>
<script type="text/javascript">
    function submitForm(formId){
        var from = $("#"+formId);
        var postUrl = from.attr("action");
        common.addMask('#FFFFFF',0.5);
        $.post(postUrl,from.serialize(),function(data){
            if(data){
                $("#errorInfo").html(data);
            }else{
                alert('注册成功，你现在可以使用注册帐号登录。');
                window.location.href = "__APP__/Member/login";
            }
            fleshVerify();
            common.removeMask();

        });
        return false;
    }

    function fleshVerify(){ 
        //重载验证码
        var time = new Date().getTime();
        document.getElementById('verifyImg').src= '__APP__/Public/verify/'+time;
    }

    function checkUsername($value){
        var postUrl = "__URL__/check_member_name";
        $.post(postUrl,{username:$value},function(data){
            if(data){
                $("#usernameInfo").html("<b style='color:#ff0000'>"+data+"</b>");
            }else{
                $("#usernameInfo").html("<b style='color:#00ff00'>可用</b>");
            }
        });
    }

    function checkEmail($value){
        var postUrl = "__URL__/check_email";
        $.post(postUrl,{email:$value},function(data){
            if(data){
                $("#emailInfo").html("<b style='color:#ff0000'>"+data+"</b>");
            }else{
                $("#emailInfo").html("<b style='color:#00ff00'>可用</b>");
            }
        });	
    }

    function checkPassword($value){
        var postUrl = "__URL__/check_password";
        $.post(postUrl,{pwd:$value},function(data){
            if(data){
                $("#passwordInfo").html("<b style='color:#ff0000'>"+data+"</b>");
            }else{
                $("#passwordInfo").html("<b style='color:#00ff00'>可用</b>");
            }
        });	
    }

    function confPassword($value){
        if($value != $("#pwd").val()){
            $("#passwordInfo").html("<b style='color:#ff0000'>两次密码不一样</b>");
        }
    }

    function setUsernameInfo(){
        $("#usernameInfo").html("3-16位字符（字母、数字、_），不区分大小写");	
    }

    function setEmailInfo(){
        $("#email").html("请输入您的常用邮箱地址");	
    }

    function setPasswordInfo(){
        $("#passwordInfo").html("6-16位字符（字母、数字、符号），区分大小写");	
    }
</script>
